﻿using ReflectionStudio.Core.Events;
using ReflectionStudio.Core.Helpers;
using System;
using System.ComponentModel;
using System.Data;
using System.Windows;
namespace WPFExcelReport
{
    /// <summary>
    /// Interaction logic for ProductionOrder.xaml
    /// </summary>
    public partial class TAMV03
    {


        public TAMV03()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VAMVALUE();
            this.DataContext = MV;
            InitializeComponent(); 
        }
        public override void OnEXAUFChg(string vlaue)
        {
            if (EXAUF.Trim().Length < 14)
            {
                TBMain.Clear();
                return;
            }
            dwData = TBMain.NewRow();
            int idx = EXAUF.IndexOf(',');
            if (idx < 0)
                return;

            dwData["AMVMANDANT"] = app.Mandant;
            dwData["AMVNRKRS"] = EXAUF.Substring(0, 2);
            dwData["AMVLFDNR"] = EXAUF.Substring(2, 4);
            dwData["AMVPOS"] = EXAUF.Substring(6, 2);
            dwData["AMVDATE"] = EXAUF.Substring(8, idx-8);
            dwData["AMVTIME"] = EXAUF.Substring(idx+1);
            SResult = TMV.QAMVALUE02(dwData);
            MergeData(SResult, false);
            base.OnEXAUFChg(vlaue); 
        }
    }
}
